package DataStructure.tree;

public class TreeMaxDepth {
    public static void main(String[] args) {
        BinaryTree<Integer, String> tree = new BinaryTree<>();
        tree.put(9,"a");
        tree.put(2,"b");
        tree.put(10,"c");
        tree.put(1,"e");
        tree.put(8,"f");
        tree.put(7,"g");
        tree.put(3,"h");
        tree.put(5,"j");
        tree.put(4,"k");
        tree.put(6,"l");
        System.out.println("最大深度为:"+tree.maxDepth());
        System.out.println("------------------------------");

        //创建数对象
        BinaryTree<String, String> tree1 = new BinaryTree<>();
        //往树中添加对象
        tree1.put("E","5");
        tree1.put("B","2");
        tree1.put("G","7");
        tree1.put("A","1");
        tree1.put("D","4");
        tree1.put("F","6");
        tree1.put("H","8");
        tree1.put("C","3");

        System.out.println("最大深度为:"+tree1.maxDepth());
    }
}
